using MeetingManagement.Application.Common;
using MeetingManagement.Infrastructure.Common;

namespace MeetingManagement.WebApi
{
    public static class DbInitializer
    {
        public static void EnsureAdmin(IServiceProvider serviceProvider)
        {
            using var scope = serviceProvider.CreateScope();
            var hasher = scope.ServiceProvider.GetRequiredService<IPasswordHasher>();
            var hash = hasher.Hash("Admin123!");
            SeedAdminUser.EnsureAdmin(
                serviceProvider,
                "admin@shinetech.com",
                "Admin",
                "Admin",
                hash
            );
        }
    }
}

